package gsw.demo.pluggable.binder;

import android.os.Parcel;
import android.os.Parcelable;

public class Item2 implements Parcelable {
    String name;
    int id;

    protected Item2(Parcel in) {
        name = in.readString();
        id = in.readInt();
    }

    public Item2(Item1 in) {
        name = in.name;
        id = in.id;
    }

    public static final Creator<Item2> CREATOR = new Creator<Item2>() {
        @Override
        public Item2 createFromParcel(Parcel in) {
            return new Item2(in);
        }

        @Override
        public Item2[] newArray(int size) {
            return new Item2[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeInt(id);
    }
}
